-- GENERATED SPELL FOR [Gjalerbron Rune-Caster] --


function spell0_23990(pUnit, Event) --@Freezing Circle,n/a--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(34787,pUnit:GetMainTank ())
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_23990', 1, 1)
end

function spell1_23990(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(9672,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23990', 7000, 1)
end

function spell2_23990(pUnit, Event) --@Rune Ward,Self--
pUnit:FullCastSpellOnTarget(43453,pUnit)
pUnit:RegisterEvent('Sorts_23990', 8293, 1)
end

function Sorts_23990(pUnit, Event)
local choix_sorts_23990 = math.random(0, 2)
if choix_sorts_23990 == 0 then
pUnit:RegisterEvent('spell0_23990', 1, 1)
end
if choix_sorts_23990 == 1 then
pUnit:RegisterEvent('spell1_23990', 1, 1)
end
if choix_sorts_23990 == 2 then
pUnit:RegisterEvent('spell2_23990', 1, 1)
end
end

function mob23990_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_23990', math.random(1500, 3000), 1)
end

function mob23990_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23990_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23990_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(23990, 1, 'mob23990_Action')
RegisterUnitEvent(23990, 2, 'mob23990_Leave')
RegisterUnitEvent(23990, 3, 'mob23990_Kill')
RegisterUnitEvent(23990, 4, 'mob23990_Die')
